package com.aabte.springbootopenfeigndemo.consumer;

import com.aabte.springbootopenfeigndemo.account.api.Account;
import com.aabte.springbootopenfeigndemo.account.api.AccountApi;
import com.aabte.springbootopenfeigndemo.core.bean.Response;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping(path = "/test")
public class TestController {

    @Resource
    private AccountApi accountApi;

    @RequestMapping(method = RequestMethod.GET, path = "/account/{id}")
    public Response<Account> queryAccountById(@PathVariable(name = "id") String accountId) {
        return accountApi.queryAccountById(accountId);
    }

}
